﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ManageProduct.aspx.cs" Inherits="HardwareAs.ManageProduct" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 <h2>Manage Product:</h2>
    <div _designerregion="0">
        <asp:Button ID="Button1" runat="server" Text="Open Insert Mode" onclick="Button1_Click" />
    <asp:ListView ID="ListView1" runat="server" EnableModelValidation="False" 
        onitemediting="ListView1_ItemEditing" oniteminserted="ListView1_ItemInserted" 
            oniteminserting="ListView1_ItemInserting" 
            onitemcanceling="ListView1_ItemCanceling" 
            onitemupdated="ListView1_ItemUpdated" 
            onitemupdating="ListView1_ItemUpdating" onitemdeleting="ListView1_ItemDeleting">
    <LayoutTemplate>
    <table border="1">
    <tr><th>ID</th><th>Title</th><th>TagLine</th><th>Description</th><th>CategoryId</th><th>ImageUrl</th><th>Keywords</th><th></th></tr>
    <asp:PlaceHolder ID="itemPlaceholder" runat="server" ></asp:PlaceHolder>
    </table>
    </LayoutTemplate>
    <ItemTemplate>
    <td><asp:Label ID="txtID" runat="server" Text='<%# Eval("Id")%>'></asp:Label></td>
 <td><asp:Label ID="lblTitle" runat="server" Text='<%# Eval("Title")%>'></asp:Label></td>
  <td><asp:Label ID="lblTagLine" runat="server" Text='<%# Eval("TagLine")%>'></asp:Label></td>
   <td><asp:Label ID="Label2" runat="server" Text='<%# Eval("Description")%>'></asp:Label></td>
    <td><asp:Label ID="Label3" runat="server" Text='<%# Eval("MTitle")+"-"+Eval("CDesc") %>'></asp:Label></td>
     <td><asp:Label ID="Label4" runat="server" Text='<%# Eval("ImageUrl")%>'></asp:Label></td>
     <td><asp:Label ID="Label1" runat="server" Text='<%# Eval("Keywords")%>'></asp:Label></td>
     <td><asp:Button ID="Button2" runat="server"  Text="Edit" CommandName="Edit" /><asp:Button ID="Button4" runat="server"  Text="Delete" OnClick="DeleteProduct" OnClientClick="return confirm('Do you want to delete?')"  CommandArgument='<%# Eval("Id")%>' /></td>
     </tr>
    </ItemTemplate>
      <EditItemTemplate>
        <tr>
        <td><asp:Label ID="txtID" runat="server" Text='<%# Eval("Id")%>'></asp:Label></td>
       <td><asp:TextBox ID="txtTitle" runat="server" Text='<%# Eval("Title")%>'></asp:TextBox></td>
  <td><asp:TextBox ID="txtTagLine" runat="server" Text='<%# Eval("TagLine")%>'></asp:TextBox></td>
   <td><asp:TextBox ID="txtDescription" runat="server" Text='<%# Eval("Description")%>'></asp:TextBox></td>
           <td> <asp:DropDownList ID="DropDownList1" runat="server" OnLoad="DropDownList2_Load" >
            </asp:DropDownList></td>
    <td><asp:TextBox ID="txtImageUrl" runat="server" Text='<%# Eval("ImageUrl")%>'></asp:TextBox></td>
     <td><asp:TextBox ID="txtKeywords" runat="server" Text='<%# Eval("Keywords")%>'></asp:TextBox></td>
     <td><asp:Button ID="Button2" runat="server"  Text="Update" CommandName="Update" />
        <asp:Button ID="Button3" runat="server"  Text="Cancel" CommandName="Cancel" /></td>
          </tr>
     </EditItemTemplate>
     <InsertItemTemplate>
       <tr>
       <td><asp:Label ID="txtID" runat="server" Text='Auto ID'></asp:Label></td>
       <td><asp:TextBox ID="txtTitle" runat="server" Text='<%# Eval("Title")%>'></asp:TextBox></td>
  <td><asp:TextBox ID="txtTagLine" runat="server" Text='<%# Eval("TagLine")%>'></asp:TextBox></td>
   <td><asp:TextBox ID="txtDescription" runat="server" Text='<%# Eval("Description")%>'></asp:TextBox></td>
    <td> <asp:DropDownList ID="DropDownList1" runat="server" OnLoad="DropDownList2_Load" >
            </asp:DropDownList></td>
     <td><asp:TextBox ID="txtImageUrl" runat="server" Text='<%# Eval("ImageUrl")%>'></asp:TextBox></td>
     <td><asp:TextBox ID="txtKeywords" runat="server" Text='<%# Eval("Keywords")%>'></asp:TextBox></td>
     <td><asp:Button ID="Button2" runat="server"  Text="Insert" CommandName="Insert" /></td>
          </tr>
     </InsertItemTemplate>

     </asp:ListView>
          

      

    </div>

</asp:Content>
